<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');$set=setting_get('tt_offer');?>
<div class="row"><div class="col-lg-10 mx-auto"><div class="card"><div class="card-body">
    <h3>后期技术支持</h3>官方网站：http://www.6rabbit.com/ <a href="http://www.6rabbit.com"target="_blank" style="text-decoration: none">点击进入</a><br>
    官方QQ群：58911696（正常群）、77868272（只吹牛不讨论正事）
</div></div><div class="card"><div class="card-body"><h3>设置允许发表悬赏的用户组</h3>
    <form action="<?php echo url('plugin-setting-tt_offer');?>" method="post" id="form">
    <table class="table"><tr><th>用户组名称</th><th>允许发表悬赏帖子</th></tr>
        <?php foreach($grouplist as $_group){?><tr><td> <?php echo $_group['name']; ?></td>
            <td><input type="checkbox" name="UallowOffer[<?php echo $_group['gid']?>]" <?php echo $_group['allowOffer']=="1"?'checked':''?>/></td>
            <?php }?></tr>
    </table>
<hr><h3>设置允许发表悬赏的板块</h3>
        <table class="table"><tr><th>板块名称</th><th>允许发表悬赏帖子</th></tr>
            <?php foreach($forumlist as $_forum){?><tr><td> <?php echo $_forum['name']; ?></td>
                <td><input type="checkbox" name="FallowOffer[<?php echo $_forum['fid']?>]" <?php echo $_forum['allowOffer']=="1"?'checked':''?>/></td>
                <?php }?></tr>
        </table>
        <hr><h3>其他设置</h3>
        设置悬赏积分段(1经验 2金币 3人民币:分)：<input class="form-control" name="offerCredits" value="<?php echo $set['credits_type'];?>"/>
    <button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
    </form>
</div></div></div></div>
<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>
<script>
    var jform = $("#form");var jsubmit = $("#submit");
    jform.on('submit', function(){
        jform.reset();jsubmit.button('loading'); var postdata = jform.serialize();
        $.xpost(jform.attr('action'), postdata, function(code, message) {
            if(code == 0) {
                $.alert(message);
                setTimeout(function() {window.location.reload();jsubmit.button('reset');}, 1000);
                return;
            } else {
                $.alert(message);jsubmit.button('reset');}
        });
        return false;
    });
</script>